<template>
	<view class="">
		<view class="flex" style="">
			<view class="  p2" style="width: 100%;padding-right: 60px;padding-left: 20px;">
				<view class="flex a-c  pb3" style="width: 600px;">
					<view class="f28 c_7" style="width: 110px;">
						开启审核
					</view>
					<view class="flex j-c" @click="ajax_is_check_examine(find.is_check_examine)">
						<view class="flex a-c  switch_sub" :class="find.is_check_examine==2 ? '' : 'j-f'">
							<view class="switch"
								:class="find.is_check_examine==1?'buttonswitchSelected':'buttonswitch'">
							</view>
						</view>
					</view>
				</view>
				<view class=" flex a-c   pb3" style="width: 600px;">
					<view class="f28 c_7" style="width: 110px;">
						搜索描述
					</view>
					<uni-easyinput v-model="find.shop_search_placeholder" placeholder="搜索描述">
					</uni-easyinput>
				</view>
				<view class=" flex a-c   pb3" style="width: 600px;">
					<view class="f28 c_7" style="width: 110px;">
						网站名称
					</view>
					<uni-easyinput v-model="find.shop_name" placeholder="网站名称">
					</uni-easyinput>
				</view>
				<view class=" flex a-c   pb3" style="width: 600px;">
					<view class="f28 c_7" style="width: 110px;">
						下载需要积分
					</view>

					<uni-easyinput v-model="json_text.download_num" type="number" placeholder="请输入积分">
					</uni-easyinput>
				</view>
				<view class=" flex a-c   pb3" style="width: 600px;">
					<view class="f28 c_7" style="width: 110px;">
						签到获得积分
					</view> 
					<uni-easyinput v-model="json_text.sing_num" type="number" placeholder="请输入积分">
					</uni-easyinput>
				</view>
				<view class=" flex a-c   pb3" style="width: 600px;">
					<view class="f28 c_7" style="width: 110px;">
						签到微信视频广告id
					</view> 
					<uni-easyinput v-model="find.mp_wx_video_ad" type="text" placeholder="微信视频广告id">
					</uni-easyinput>
					<text class="cred f26 ml1">空则不弹出视频广告可直接签到</text>
				</view>
				<view class=" flex a-c   pb3" style="width: 600px;">
					<view class="f28 c_7" style="width: 110px;">
						签到抖音视频广告id
					</view> 
					<uni-easyinput v-model="find.mp_dou_video_ad" type="text" placeholder="抖音视频广告id">
					</uni-easyinput>
					<text class="cred f26 ml1">空则不弹出视频广告可直接签到</text>
				</view>
				<view class=" flex a-c   pb3" style="width: 600px;">
					<view class="f28 c_7" style="width: 110px;">
						投稿获得积分
					</view>
					<uni-easyinput v-model="json_text.tg_num" type="number" placeholder="请输入积分">
					</uni-easyinput>
				</view>
				<view class="   a-c   pb3" style="width: 100%;">
					<view class="f28 c_7 pb2" style="width: 110px;">
						投稿说明
					</view>
					<mosoweEditor v-if="json_text.tg_text" @change="on_ok" :content="json_text.tg_text" :height="500"
						placeholder="请输入投稿说明" mode="default">
					</mosoweEditor>
				</view>

				<view class=" flex j-b pb3" style="width: 340px;">
					<view class="  ">
						<view class="pb2 c_7 f18  ">
							首页顶部背景图
						</view>
						<image :src="url+find.home_img" style="width: 230px;height: 120px;" mode=""></image>

					</view>
					<view class="" style="padding-top: 130px;">
						<button class=" " @click="on_img()" type="primary" size="mini">更换图片</button>
					</view>
				</view>
			</view>

		</view>

		<view class="  p2" style="margin-left: 445px;">
			<button class=" " @click="on_users_cx()" type="primary" style="width: 200px;" size="mini">保存</button>

		</view>


		<uni-popup ref="alertDialog_image" type="dialog">
			<uni-popup-image :imgList="imgList.length" :count="1" t_type="images" :t_name="t_name" @confirm="confirm">
			</uni-popup-image>
		</uni-popup>




	</view>
</template>

<script>
 
	import mosoweEditor from '@/components/editor/editor.vue'

	export default {
		components: {

			mosoweEditor

		},
		data() {
			return {
				lbs_sing: '',
				shop_search_placeholder: '',
				shop_name: '',
				find: {
					is_check_examine: 1
				},
				url: '',
				find_sc: {},
				t_name: '图片',
				t_type: 'imgags',
				imgList: [],
				json_text: {}

			}
		},
		onLoad() {
			this.init();
		},
		methods: {
			on_ok(val) {
				this.json_text.tg_text = val;
			},
			ajax_adopt(index) {
				var that = this;
				if (index == 1) {
					this.find['is_check_pay'] = 0
				} else {
					this.find['is_check_pay'] = 1
				}
				that.on_users_cx();
			},
			ajax_is_check_examine(index) {
				var that = this;
				if (index == 2) {
					this.find.is_check_examine = 1
				} else {
					this.find.is_check_examine = 2
				}

				that.on_users_cx();
			},
			on_jiaocheng() {
				uni.navigateTo({
					url: '/pages/banmi/tx_map_jiao'
				})
			},
			confirm(vals) {
				if (vals.length == 0) {
					this.find.home_img = ''
					return
				}
				this.find['home_img'] = vals[0]['attachment']
			},

			on_img() {
				this.$refs.alertDialog_image.open()
				return


			},


			init() {
				var that = this; 
				let requestParams = {

				};
				this.Htpp.post('banmichaoqiangbizhi.Tongchengset/finds_sjsz', 'app', {
					token: false,
					datalist: requestParams
				}).then(ret => {
					var ret = ret.data;
					this.find = ret.data.find;
					
	 
					this.find['top_price'] = this.find['top_price'] / 100;
					this.find_sc = ret.data.find_sc;
					this.json_text = JSON.parse(this.find.json_text);
					this.url = ret['img_url']
				})


			},
			on_tab(index) {
				this.tabindex = index;
			},
			on_users_cx() {
				var that = this; 
				that.find.json_text = JSON.stringify(this.json_text); 
				this.Htpp.post('banmichaoqiangbizhi.Tongchengset/updates_sztcxx', 'app', {
					token: false,
					datalist: that.find
				}).then(ret => {
					var find = ret.data.data;
					uni.showToast({
						title: ret.data.msg,
						icon: 'none'
					})

				})
			},

		}
	}
</script>

<style>
	page {
		background-color: #fff;
	}

	.feng {
		color: red;
	}
</style>